package model

import (
	"time"
)

// 好友请求
type FriendRequest struct {
	Id             int       `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT;comment:表id" json:"id"`
	UserId         int       `gorm:"column:user_id;type:int(11);comment:申请好友的用户id;NOT NULL" json:"user_id"`
	FriendId       int       `gorm:"column:friend_id;type:int(11);comment:被申请好友的用户id;NOT NULL" json:"friend_id"`
	Status         int       `gorm:"column:status;type:tinyint(4);default:1;comment:是否处理, 1未处理，2同意, 3不同意;NOT NULL" json:"status"`
	AddInformation string    `gorm:"column:add_information;type:varchar(100);comment:好友验证信息" json:"add_information"`
	Note           string    `gorm:"column:note;type:varchar(100);comment:好友备注" json:"note"`
	CreateTime     time.Time `gorm:"column:create_time;type:datetime;comment:表创建时间;NOT NULL" json:"create_time"`
	User           User      `gorm:"foreignKey:UserId"`
	Friend         User      `gorm:"foreignKey:FriendId"`
}

func (m *FriendRequest) TableName() string {
	return "friend_request"
}
